#include <stdlib.h>
#include <uuid/uuid.h>

#define NIT_SHORT_NAMES
#include <nit/macros.h>
#include <nit/palloc.h>

#include "des.h"
#include "sym.h"

Inb_sym *
inb_sym_new(uuid_t id, const char *str)
{
	Inb_sym *sym;
	Inb_des *des = inb_palloc(sym);

	pcheck(des, NULL);
	des->type = SYM;
	des->flags = INB_FREE;
	sym = inb_thing(des);
	id ? uuid_copy(sym->id, id) : uuid_generate(sym->id);
	sym->str = str;
	return sym;
}
